<template>
    <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="渠道关联与返点" name="0" :lazy="true"><index/></el-tab-pane>
        <el-tab-pane label="数据报表" name="1" :lazy="true"><day-cpa-cost/></el-tab-pane>
        <el-tab-pane label="授权流程" name="2" :lazy="true"><course/></el-tab-pane>
        <el-tab-pane label="点击监测链接" name="3" :lazy="true"><click-callback-url/></el-tab-pane>
    </el-tabs>
</template>

<script>
import Index from './index'
import Course from './course'
import DayCpaCost from './day-cpa-cost'
import ClickCallbackUrl from './click-callback-url'

export default {
    data() {
        return {
            activeName: '0',
            configs: {},
        };
    },
    components: {
        Index,
        Course,
        DayCpaCost,
        ClickCallbackUrl,
    },
    methods: {
        handleClick(tab, event) {

        },
        getConfigs() {
            this.$store.dispatch('appSourceCpa/GetConfigs').then(({data}) => {
                this.configs = data;
                // if (this.configs.kuaishou && !this.configs.kuaishou.advertiser_ids.length) {
                //     this.$alert('请先完成快手授权').finally(() => {
                //         this.activeName = '2';
                //     });
                //     return ;
                // }
                // if (this.configs.douyin && !this.configs.douyin.advertiser_ids.length) {
                //     this.$alert('请先完成抖音授权').finally(() => {
                //         this.activeName = '2';
                //     });
                // }
            });
        },
    },
    created() {
        this.getConfigs();
    }
};
</script>

<style scoped>

</style>
